type Mutable [out T]
    native;  // rx.Mutable

type Buffer native;  // rx.Buffer


export function Mutable:[T]
    &(T) => Sync[Mutable[T]]
    native '__Mutable';

function mutable-read:
    [T] &(Mutable[T]) => Sync[T]
    native '__MutableRead';

function mutable-write:
    [T] &(Mutable[T], T) => Sync
    native '__MutableWrite';

export method Mutable.read: Sync[T]
    &(m) => { mutable-read m };

export method Mutable.write: &(T) => Sync
    &(m) => &(v) => { mutable-write (m, v) };

// TODO: buffer operations


